﻿@model Sys_Admin
@{
    ViewBag.ParentUrl = "/Admin/Edit";
    ViewBag.Title = "编辑系统帐号";
}
@section header{
}
@section breadcrumb
{
    <ul class="breadcrumb">
        <li>
            <i class="ace-icon fa fa-home home-icon"></i>
            <a href="/">首页</a>
        </li>
        <li>
            <a href="/Admin/Index">帐号管理</a>
        </li>
        <li class="active">@ViewBag.Title</li>
    </ul><!-- .breadcrumb -->
}
<div class="col-sm-10">
    <form class="form-horizontal" id="frm" action="/Admin/Edit" method="POST">
        <div class="tabbable">
            <ul class="nav nav-tabs padding-16">
                <li class="active">
                    <a href="###">
                        <i class="green ace-icon fa fa-pencil-square-o bigger-125"></i>
                        编辑信息
                    </a>
                </li>
            </ul>

            <div class="tab-content profile-edit-tab-content">
                <div id="edit-basic" class="tab-pane in active">
                    <h4 class="header blue bolder smaller">
                        头像
                        <small id="uploadTips">
                        </small>
                    </h4>
                    @Html.HiddenFor(o => o.A_Id)
                    <div class="row">
                        <!-- 封面、图片 -->
                        <div class="col-xs-12 col-sm-3 center">
                            <div class="form-group">
                                <label class="col-sm-3 control-label no-padding-right"> 头像 </label>
                                <div class="col-sm-9" style="text-align:left;">
                                    <img id="imgA_HeadImg" src="@string.Format("{0}", string.IsNullOrEmpty(Model.A_HeadImg) ? "/static/img/uploadpic.png" : ViewBag.StaticSiteUrl + Model.A_HeadImg)" style="width: 135px;height:113px;" alt="" />
                                    @Html.HiddenFor(o => o.A_HeadImg)
                                </div>
                            </div>
                        </div>
                    </div>
                    <hr />

                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right" for="A_Role">角色</label>

                        <div class="col-sm-9">
                            @Html.DropDownList("A_Role", (IEnumerable<SelectListItem>)TempData["RoleList"], new { @class = "col-xs-12 col-sm-3", style = "margin-right:3px;" })
                        </div>
                    </div>

                    <div class="space-4"></div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right" for="A_Account">用户名</label>

                        <div class="col-sm-9">
                            <span class="input-icon input-icon-right">
                                @Html.TextBoxFor(o => o.A_Account, new { placeholder = "帐号用户名",required = "required"  ,data_max="20" ,data_min="5"})
                            </span>
                        </div>
                    </div>

                    <div class="space-4"></div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right" for="A_Phone">联系电话</label>

                        <div class="col-sm-9">
                            <span class="input-icon input-icon-right">
                                @Html.TextBoxFor(o => o.A_Phone, new { placeholder = "手机/固话电话", required = "required", data_max = "20", data_min = "5" })
                            </span>
                        </div>
                    </div>

                    <div class="space-4"></div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right" for="A_Pwd">密码</label>

                        <div class="col-sm-9">
                            <span class="input-icon input-icon-right">
                                @Html.PasswordFor(o => o.A_Pwd, new { placeholder = "帐号密码", required = "required", data_max = "30", data_min = "5" })
                            </span>
                        </div>
                    </div>


                    <div class="space-4"></div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right" for="ConfirmPwd">确认密码</label>

                        <div class="col-sm-9">
                            <span class="input-icon input-icon-right">
                                @Html.Password("ConfirmPwd", null,new { placeholder = "再次输入密码", required = "required", data_max = "30", data_min = "5" })
                            </span>
                        </div>
                    </div>

                    <div class="space-4"></div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right" for="A_Account">昵称</label>

                        <div class="col-sm-9">
                            <span class="input-icon input-icon-right">
                                @Html.TextBoxFor(o => o.A_Name, new { placeholder = "取个昵称吧", required = "required", data_max = "20"})
                            </span>
                        </div>
                    </div>

                    <div class="space-4"></div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right">性别</label>

                        <div class="col-sm-9">
                            <label class="inline">
                                <input name="A_Sex" type="radio" class="ace" value="1" />
                                <span class="lbl middle"> 先生</span>
                            </label>

                            &nbsp; &nbsp; &nbsp;
                            <label class="inline">
                                <input name="A_Sex" type="radio" class="ace" value="0" />
                                <span class="lbl middle"> 女士</span>
                            </label>
                        </div>
                    </div>

                    <div class="space-4"></div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right" for="A_Remark">备注</label>

                        <div class="col-sm-9">
                            @Html.TextAreaFor(o => o.A_Remark, new { @class = "col-xs-12 col-sm-10", placeholder = "备注，管理员的联系地址" })
                        </div>
                    </div>
                    <div class="space-4"></div>
                </div>
            </div>
        </div>

        <div class="clearfix form-actions">
            <div class="col-md-offset-3 col-md-9">
                <button class="btn btn-info" type="submit" id="btnSubmit">
                    <i class="ace-icon fa fa-check bigger-110"></i>
                    确定并保存
                </button>

                &nbsp; &nbsp;
                <button class="btn" type="reset">
                    <i class="ace-icon fa fa-undo bigger-110"></i>
                    取消
                </button>
            </div>
        </div>
    </form>
</div><!-- /.span -->
@section footerScript
{
    <!--标签tag插件-->
    <script src="/assets/js/validation/jquery-html5Validate.js"></script>
    <script src="@Url.Content("~/assets/js/file-upload/ajaxupload.js")" type="text/javascript"></script>
    <script src="/assets/js/laydate/laydate.js"></script>
    <script src="~/js/common.js"></script>
}
@section footer
{
    <script>
        $("#frm").html5Validate(function () {

            if ($("#A_Pwd").val() !== $("#ConfirmPwd").val()) {
                $("#ConfirmPwd").testRemind("前后密码不一致");
                return false;
            }
            this.submit();
        }, {

        });


        /*上传楼盘封面*/
        common.ImagesUploadFileFun1('imgA_HeadImg', 'A_HeadImg', 'admin');

    </script>
}
